package com.business.exam.service.impl;

import java.util.List;
import com.business.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.business.exam.mapper.ExamQbQuestionsMapper;
import com.business.exam.domain.ExamQbQuestions;
import com.business.exam.service.IExamQbQuestionsService;

/**
 * 题库Service业务层处理
 *
 * @author zhanglele
 * @date 2023-12-04
 */
@Service
public class ExamQbQuestionsServiceImpl implements IExamQbQuestionsService
{
    @Autowired
    private ExamQbQuestionsMapper examQbQuestionsMapper;

    /**
     * 查询题库
     *
     * @param qbMainId 题库主键
     * @return 题库
     */
    @Override
    public ExamQbQuestions selectExamQbQuestionsByQbMainId(Long qbMainId)
    {
        return examQbQuestionsMapper.selectExamQbQuestionsByQbMainId(qbMainId);
    }

    /**
     * 查询题库列表
     *
     * @param examQbQuestions 题库
     * @return 题库
     */
    @Override
    public List<ExamQbQuestions> selectExamQbQuestionsList(ExamQbQuestions examQbQuestions)
    {
        return examQbQuestionsMapper.selectExamQbQuestionsList(examQbQuestions);
    }

    /**
     * 新增题库
     *
     * @param examQbQuestions 题库
     * @return 结果
     */
    @Override
    public int insertExamQbQuestions(ExamQbQuestions examQbQuestions)
    {
        examQbQuestions.setCreateTime(DateUtils.getNowDate());
        return examQbQuestionsMapper.insertExamQbQuestions(examQbQuestions);
    }

    /**
     * 修改题库
     *
     * @param examQbQuestions 题库
     * @return 结果
     */
    @Override
    public int updateExamQbQuestions(ExamQbQuestions examQbQuestions)
    {
        examQbQuestions.setUpdateTime(DateUtils.getNowDate());
        return examQbQuestionsMapper.updateExamQbQuestions(examQbQuestions);
    }

    /**
     * 批量删除题库
     *
     * @param qbMainIds 需要删除的题库主键
     * @return 结果
     */
    @Override
    public int deleteExamQbQuestionsByQbMainIds(Long[] qbMainIds)
    {
        return examQbQuestionsMapper.deleteExamQbQuestionsByQbMainIds(qbMainIds);
    }

    /**
     * 删除题库信息
     *
     * @param qbMainId 题库主键
     * @return 结果
     */
    @Override
    public int deleteExamQbQuestionsByQbMainId(Long qbMainId)
    {
        return examQbQuestionsMapper.deleteExamQbQuestionsByQbMainId(qbMainId);
    }
}
